home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / cron.postinst < prev    next >
Encoding:
Text File  |  2010-12-18  |  2.1 KB  |  71 lines

  1. #!/bin/sh
  2. set -e
  3.  
  4. if [ -x "/etc/init.d/cron" ]; then
  5.     update-rc.d cron start 89 2 3 4 5 . >/dev/null || exit $?
  6. fi
  7. # Copy existing allow/deny files
  8. crondir="/var/spool/cron"
  9. pausemessage="F"
  10. for fname in allow deny ; do
  11.     if [ -f $crondir/$fname ] ; then
  12.     if [ ! -f $/etc/cron.$fname ] ; then
  13.         mv $crondir/$fname /etc/cron.$fname
  14.         echo " "
  15.         echo "Moving $crondir/$fname to /etc/cron.$fname to comply with Debian policy"
  16.         pausemessage="T"
  17.     else
  18.         echo " "
  19.         echo "Warning:"
  20.         echo "Both $crondir/$fname and /etc/cron.$fname exist -- cron will"
  21.         echo "use /etc/cron.$fname"
  22.         pausemessage="T"
  23.     fi
  24.     fi
  25. done
  26.  
  27. # Conffile has become obsolete
  28. dpkg-maintscript-helper rm_conffile /etc/cron.monthly/standard "3.0pl1-113" -- "$@"
  29. # If dpkg-maintscript-helper renames it instead of removing it because it has
  30. # local modifications, we must rename it back to a valid name, or crond
  31. # will not accept it. Thanks to Rapha├½l Hertzog for the tip.
  32. if [ -e /etc/cron.monthly/standard.dpkg-bak ]; then
  33.     mv /etc/cron.monthly/standard.dpkg-bak \
  34.         /etc/cron.monthly/standard-obsolete-please-verify-and-remove
  35. fi
  36.  
  37. # Add group for crontabs
  38. getent group crontab > /dev/null 2>&1 || addgroup --system crontab
  39.  
  40. # Fixup crontab binary for new group 'crontab'.
  41. if ! dpkg-statoverride --list /usr/bin/crontab > /dev/null ; then
  42.     dpkg-statoverride --update --add root crontab 2755 /usr/bin/crontab
  43. fi
  44.  
  45. # Fixup crontab , directory and files for new group 'crontab'.
  46. # Can't use dpkg-statoverride for this because it doesn't cooperate nicely
  47. # with cron alternatives such as bcron
  48. if [ -d $crondir/crontabs ] ; then
  49.     chown root:crontab $crondir/crontabs
  50.     chmod 1730 $crondir/crontabs
  51.     # This used to be done conditionally. For versions prior to "3.0pl1-81"
  52.     # It has been disabled to suit cron alternative such as bcron. 
  53.     cd $crondir/crontabs
  54.     set +e
  55.     ls -1 | xargs -r -n 1 --replace=xxx  chown 'xxx:crontab' 'xxx'
  56.     ls -1 | xargs -r -n 1 chmod 600
  57.     set -e
  58. fi
  59.  
  60. if [ -x /etc/init.d/cron ]; then
  61.     if [ -x /usr/sbin/invoke-rc.d ] ; then
  62.            invoke-rc.d cron start
  63.     else
  64.            /etc/init.d/cron start
  65.     fi
  66. fi
  67.  
  68.  
  69.  
  70.  
  71.